<template>
  <view class="success-container">
    <cu-custom bgColor="bg-gradual-green" :isBack="true" @back="goBack">
      <template v-slot:content>支付成功</template>
    </cu-custom>
    <view class="content">
      <view class="icon-wrap">
        <text class="cuIcon-check text-green success-icon"></text>
      </view>
      <view class="title">支付成功</view>
      <view class="subtitle text-gray"
        >您的订单已支付成功，我们会尽快为您处理</view
      >
      <view class="button-wrap">
        <button class="cu-btn bg-green lg round" @click="goBack">
          返回首页
        </button>
      </view>
    </view>
  </view>
</template>

<script setup>
const goBack = () => {
  // 跳转到首页
  uni.switchTab({
    url: "/pages/index/HomePage",
  });
};
</script>

<style scoped>
.success-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background-color: #f5f5f5;
}
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40rpx;
}
.icon-wrap {
  margin-bottom: 40rpx;
}
.success-icon {
  font-size: 120rpx;
}
.title {
  font-size: 48rpx;
  font-weight: bold;
  margin-bottom: 20rpx;
}
.subtitle {
  font-size: 28rpx;
  margin-bottom: 80rpx;
  text-align: center;
}
.button-wrap {
  width: 100%;
  padding: 0 40rpx;
}
.button-wrap .cu-btn {
  width: 100%;
}
</style>
